package chapter01;

public class Test03_Transform {
    public static void main(String[] args) {
        //从小到大可以 自动转换
        byte a = 10;
        int x = a;
        System.out.println(x);
        //运算的过程中 也可以发生自动类型转换 byte short int long float double
        byte d = 127;
        int e = a+d;
        System.out.println(e);
        //从大到小 只能强制转换 精度损失
        int b = 20;
        byte c = (byte) b;
        System.out.println(c);
        int h = 256;
        byte g = (byte)h;
        System.out.println(g);
    }
}
